const path = require('path')
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
  assetsDir:'statics',
  devServer: {
    host: 'localhost',
    port: 8096,
    https: false,
    hot: true, // 启用热模块替换 (HMR)
    client: {
      overlay: false // 编译错误时，取消全屏覆盖（建议关掉）
    }
  },
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [
        path.resolve(__dirname, './src/assets/css/variables.less'),
        path.resolve(__dirname, './src/assets/css/mixin.less')
      ]
    }
  },
  runtimeCompiler: true,
  productionSourceMap: false,
  // css相关配置
  css: {
    // 是否使用css分离插件 ExtractTextPlugin
    extract: process.env.NODE_ENV === 'production',
    // 开启 CSS source maps?
    sourceMap: process.env.NODE_ENV === 'development'
  }
})
